#include<stdio.h>
#include<string.h>
int main(int argc,char** argv)
{
    if(argc!=2)
    {
        printf("usage:%s filename\n",argv[0]);
        return 1;
    }
    FILE* fp=fopen(argv[1],"r");
    if(fp==NULL)
    {
        perror("fopen");
        return 2;
    }
    while(1)
    {
        char buffer[128];
        memset(buffer,0,sizeof(buffer));
        int n=fread(buffer,1,sizeof(buffer)-1,fp);//-1是为了预留一个位置给\0
        if(n)
        {
            printf("%s",buffer);
        }
        if(feof(fp)) break;
    }
    fclose(fp);
    return 0;

}
